<?php namespace Summer\Hub;

use Backend\Classes\ListColumn;
use Lang;
use Model;

class ListMediaImgField
{

    public static function render($value, ListColumn $column, Model $record)
    {
        $prefix=$column->config['prefix']??'/storage/app/media';
        if($value){
            return '
            <a data-toggle="modal" href="#contentBasic'.$record->id.'">
                <img src="'.$prefix.$value.'">
            </a>

            <div class="control-popup modal fade" id="contentBasic'.$record->id.'" tabindex="-1" role="dialog">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-body">
                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                            <img style="width: 100%" src="'.$prefix.$value.'">
                        </div>
                    </div>
                </div>
            </div>
            ';
        }

    }


}